* generate the additional variable  --------------------------------------------

gen coffins_squared = coffins * coffins

* label the additional variables -----------------------------------------------

label variable coffins             "Treatments"
label variable coffins_squared     "Treatments Squared"

* run the regressions models and save them to memory ---------------------------

eststo: reg akp_nov coffins akp_jun recruitment_pool, cluster(province)

eststo: reg akp_nov coffins akp_jun recruitment_pool                            ///
treatment_nonterror casualty_district kurdish_district akp_district             ///
higher_education min_margin turnout_jun, cluster(province)

eststo: reg akp_nov coffins coffins_squared akp_jun recruitment_pool,           ///
cluster(province)

eststo: reg akp_nov coffins coffins_squared akp_jun recruitment_pool            ///
treatment_nonterror casualty_district kurdish_district akp_district             ///
higher_education min_margin turnout_jun, cluster(province)

* print the results ------------------------------------------------------------

esttab,                                                                         ///
replace se b(3) se(3) stats(N vce r2) label nodepvars nonotes nomtitles         ///
order(coffins coffins_squared)                                                  ///
substitute(vce "Clusters" cluster "81")                                         ///
title("Table S7: Regression models with quadratic treatment")

* save the results -------------------------------------------------------------

esttab using "./tables/table_s7.tex",                                           ///
replace se b(3) se(3) stats(N vce r2) label nodepvars nonotes nomtitles         ///
order(coffins coffins_squared)                                                  ///
substitute(vce "Clusters" cluster "81")                                         ///
title("Regression models with quadratic treatment")

* drop the additional variable -------------------------------------------------

drop coffins_squared

* remove the models from memory ------------------------------------------------

eststo clear